/*
 * Copyright (c) 2013   Tobias Welther
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package de.tudarmstadt.kom.androidsensorapi.sensor.data.concrete;

import java.util.Date;

import de.tudarmstadt.kom.androidsensorapi.sensor.data.AbstractSensorData;

/**
 * Created by Tobias Welther
 */
public class OrientationSensorData extends AbstractSensorData{

    /**
     * This is the degree value in which direction (compass) the Orientation sensor is pointing.
     * Values are between 0 and 360.
     */
    private final float azimuth;

    /**
     * The vertical alignment of the Orientation data.
     * Values are between -180 and 180.
     */
    private final float pitch;

    /**
     * The roll value of the Orientation.
     * Values are between -90 and 90.
     */
    private final float roll;

    /**
     * Creates a SensorInterface Data Set with an creation date.
     *
     * @param dateOfCreation the date the data is created
     * @param azimuth the compass direction in degree
     * @param pitch the pitch of the Orientation
     * @param roll
     */
    public OrientationSensorData(Date dateOfCreation, float azimuth, float pitch, float roll) {
        super(dateOfCreation);

        this.azimuth = azimuth;
        this.pitch = pitch;
        this.roll = roll;
    }


    //We don't have a copy constructor from an SensorEvent here,
    //since this is not calculated through one single SensorEvent.


    /**
     * This is the degree value in which direction (compass) the Orientation sensor is pointing.
     * Values are between 0 and 360.
     *
     * @return the azimuth of the orientation
     */
    public float getAzimuth() {
        return azimuth;
    }


    /**
     * The vertical alignment of the Orientation data.
     * Values are between -180 and 180.
     *
     * @return the pitch of the orientation
     */
    public float getPitch() {
        return pitch;
    }

    /**
     * The roll value of the Orientation.
     * Values are between -90 and 90.
     *
     * @return  the roll value of the orientation
     */
    public float getRoll() {
        return roll;
    }
}
